package com.numberone.master.modules.news.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.numberone.master.common.persistence.Page;
import com.numberone.master.common.service.CrudService;
import com.numberone.master.modules.news.entity.News;
import com.numberone.master.modules.news.dao.NewsDao;

/**
 * 消息推送Service
 * @author chengkang
 * @version 2018-02-23
 */
@Service
@Transactional(readOnly = true)
public class NewsService extends CrudService<NewsDao, News> {
	
	@Autowired
	private NewsDao newsDao;
	
	public News get(String id) {
		return super.get(id);
	}
	
	public List<News> findList(News news) {
		return super.findList(news);
	}
	
	public Page<News> findPage(Page<News> page, News news) {
		return super.findPage(page, news);
	}
	
	@Transactional(readOnly = false)
	public void save(News news) {
		super.save(news);
	}

	@Transactional(readOnly = false)
	public void update(News news) {
		super.update(news);
	}
	
	@Transactional(readOnly = false)
	public void delete(News news) {
		super.delete(news);
	}
	
	@Transactional(readOnly = false)
	public int getCount(String acceptUserId,String seeState){
		return newsDao.getCount(acceptUserId,seeState);
	}
	
}